<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="page" uri="/WEB-INF/tld/page.tld"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系统- 用户管理</title>
<link href="<%=basePath%>/css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=basePath%>/js/jquery/jquery-1.7.1.js"></script>
<script type="text/javascript">
function add(){
	parent.openWin("<%=basePath%>/createUser.do",640,300,'用户管理','注册用户','');
}
function edit(userId){
	parent.openWin("<%=basePath%>/editUser.do?userId="+userId,640,300,'用户管理','修改用户','');
}
function goToPage(curPage){
	$("#queryPageCurPage").val(curPage);
	$("#userQueryForm").submit();
}
</script>
</head>
<body>
<table width="100%" border="0" cellspacing="6" cellpadding="0" style="border-collapse:separate; border-spacing:6px;">
	<tr valign="top">
		<td>
			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="blockTable">
				<tr>
					<td width="65%" style="padding:6px 10px;" class="blockTd">
						<div style="float: left">
							<a href='javascript:void(0);' ztype='zPushBtn' class='zPushBtn' hidefocus='true' tabindex='-1' onselectstart='return false' id='BtnAdd' onClick="add();return false;" priv="article_modify">
								 <img src="<%=basePath%>/images/icons/icon003a2.gif" width="20" height="20"/><b>注册</b>
							</a>
						</div>
					</td>
				</tr>
				<tr>
					<td style="padding:2px 10px;">
						<form id="userQueryForm"  name="userQueryForm" action="${pageContext.request.contextPath}/listUser.do" method="post" target="consoleFrame" >
						<input name="queryPage.curPage" id="queryPageCurPage" type="hidden" value="${queryPage.curPage}">
						<div style="float: left;">
							<label>
							用户类型:
							<select name="userQueryForm.userType">
								<option value="">所有</option>
								<option value="USER_TYPE_SYSTEM">系统</option>
								<option value="USER_TYPE_TRAVELAGENCY">旅行社</option>
								<option value="USER_TYPE_SIGHT">景区</option>
							</select>
							</label>
							<label style="margin-left:5px">
							标题:
							<input name="userQueryForm.title" value="${userQueryForm.title}" type="text" size="15"/>
							</label>
							<label style="margin-left:5px">
							登录名:
							<input name="userQueryForm.userName" value="${userQueryForm.userName}" type="text" size="15"/>
							</label>
							<label style="margin-left:5px">
							姓名:
							<input name="userQueryForm.realName" value="${userQueryForm.realName}" type="text" size="15"/>
							</label>
							<label style="margin-left:5px">
							电话:
							<input name="userQueryForm.phone" value="${userQueryForm.phone}" type="text" size="15"/>
							</label>																			
							<input style="margin-left:10px" id="Submitbutton" class="inputButton" type="submit" value="查询" name="Submitbutton"/>
						</div>
						</form>
					 </td>
				</tr>
				<tr>
					<td style="padding-top:2px;padding-left:6px;padding-right:6px;padding-bottom:2px;">
						<table width="100%" cellpadding="2" cellspacing="0" class="dataTable">
							<tr ztype="head" class="dataTableHead">
								<td width="10%"><strong>用户类型</strong></td>
								<td width="15%"><strong>标题</strong></td>
								<td width="10%"><strong>登录名</strong></td>
								<td width="10%"><strong>姓名</strong></td>
								<td width="20%"><strong>电话</strong></td>
								<td width="10%"><strong>是否启用</strong></td>
								<td width="20%"><strong>修改时间</strong></td>
								<td width="10%"><strong>操作</strong></td>
							</tr>
							<c:forEach items="${userList}" var="item">
							<tr>
								<td>${item.userTypeCn}</td>
								<td>${item.title}</td>
								<td>${item.userName}</td>
								<td>${item.realName}</td>
								<td>${item.phone}</td>
								<td align="center">${item.isLock eq 'true'?'否':'是'}</td>
								<td>${item.updateTime}</td>
								<td>
									<a href='javascript:void(0);' ztype='zPushBtn' class='zPushBtn' hidefocus='true' tabindex='-1' onselectstart='return false' id='BtnAdd' onClick="edit('${item.userId}');return false;" priv="article_modify">
										 <b>修改</b>
									</a>
								</td>
							</tr>
							</c:forEach>													
							<tr ztype="pagebar">
								<td colspan="100%" align="left">
								<div style='float:right;font-family:Tahoma'>
									<a href="javascript:goToPage('1');">第一页</a>
										&nbsp;
									<c:if test="${((queryPage.curPage) > 1)}">
									|&nbsp;<a href="javascript:goToPage('${(queryPage.curPage-1)}');">上一页</a>
									&nbsp;|
									</c:if>&nbsp;
									<c:if test="${queryPage.curPage< queryPage.pageCount}">
										<a href="javascript:goToPage('${(queryPage.curPage+1)}');">下一页</a>&nbsp;|&nbsp;<a href="javascript:goToPage('${(queryPage.pageCount)}');">最末页</a>
									</c:if>
									&nbsp;&nbsp;
									转到第&nbsp;<input id="gotopage" type='text' class='inputText' style='width:40px' onKeyUp="value=value.replace(/\D/g,'')">&nbsp;页&nbsp;&nbsp;<input type='button' onclick="if(!/^\d+$/.test($('#gotopage').val())){alert('错误的页码');$('#gotopage').focus();}else{goToPage($('#gotopage').val());}" class='inputButton' value='跳转'>
								</div>
								<div style='float:left;font-family:Tahoma'>共 ${(queryPage.totalItem)} 条记录，每页  ${(queryPage.pageSize)} 条，当前第  ${(queryPage.curPage)} / ${(queryPage.pageCount)} 页</div>
								</td>
							</tr>
						</table>
					</td>					
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>
<script type="text/javascript">
	$(function(){
		$("select[name='userQueryForm.userType']").val("${userQueryForm.userType}");
	});
</script>